package com.ljx.qqpro.common.utils;

import lombok.Data;

@Data
public class Result<T> {

    private Boolean success;

    private String message;

    private T data;

    protected Result(Boolean success, T data, String message) {
        this.success = success;
        this.message = message;
        this.data = data;
    }

    public static <T> Result<T> success(T data, String message) {
        return new Result<T>(true, data, message);
    }

    public static <T> Result<T> fail(T data, String message) {
        return new Result<T>(false, data, message);
    }
}
